<?php
/**
 * Created by PhpStorm.
 * User: Yueool
 * Date: 2018/8/10
 * Time: 12:30
 */

namespace common\models;

use Yii;


class Correct{


    /**
     * 与上边相邻的数据交换
     * @param $id
     * @return bool
     */
    public static function getSqlCondition($correct){

        switch($correct){
            case "all" :
                return "";
            case "none" :
                return " AND FALSE";
            case "0-15" :
                return " AND w.correct_write<16";
            case "1-" :
                return " AND w.correct_write>0";
            case "0,16-" :
                return " AND (w.correct_write=0 OR w.correct_write>15)";
            case "0" :
                return " AND w.correct_write=0";
            case "1-15" :
                return " AND w.correct_write>0 AND w.correct_write<16";
            case "16-" :
                return " AND w.correct_write>15";
            default :
                return " AND w.correct_write<16";
        }

    }

}